<?php
/**
 * Created by PhpStorm.
 * User: cy
 * Date: 18-3-3
 * Time: 下午4:31
 * 设定抢购商品的库存数量
 */
$goodsId=10;
$goodsNum=10;//抢购数量
$redisKey='seckill_count_'.$goodsId;
$redis=new Redis();
$redis->connect('127.0.0.1',6379);
for($i=0;$i<$goodsNum;$i++){
    $redis->lPush($redisKey,1);
}
echo "设置库存成功，goodsId:$goodsId,num:".$redis->lLen($redisKey);